PBOffLine
PBOffLine Take a volume off-line
#include <Files.h> File Manager (PBxxx)
ParmBlkPtr pb ; address of a 64-byte VolumeParam structure
returns Error Code; 0=no error
PBOffLine flushes a volume's buffer to disk and releases the memory used
by that buffer. The volume will be placed back on-line trans parently by the
File Manager, when next it is needed.
pb is the address of a 64-byte VolumeParam structure or any of the
variants which contain all the relevant fields:
Out-In Name Type Size Offset Description
-> ioCompletion ProcPtr 4 12 Completion routine address (if async =TRUE)
-> ioNamePtr StringPtr 4 18 Address of volume name (or NIL)
-> ioVRefNum short 2 22 Volume reference number
<- ioResult OSErr 2 16 Error Code (0=no error, 1=not done yet)
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
bdNamErr (-37) Bad name
extFSErr (-58) External file system
nsDrvErr (-56) No such drive
nsvErr (-35) No such volume
paramErr (-50) No default volume

Notes: If you are using a string in the ioNamePtr field to specify a volume name,
the string must be in the following form
myVolParam.ioNamePtr = "\pMy HardDisk:
The trailing colon on the string indicates that we are referring to a
directory, not a file.
The idea of an off-line volume lets you pretend that several different disks
are in the drive simultaneously. Then when you wish to read a file from one
of those disks, the File Manager will prompt the user to insert the correct
one.
The volume control block remains in memory, so calls to PBGetVInfo et
al., will function as if the volume was still active. The PBEject function
calls PBOffLine automatically.
The only advantage of using PBOffLine directly is that it frees up some
memory. You might include logic to "off-line" extra volumes in a custom
heap-grow procedure (see the Memory Manager SetGrowZone function).
Use PBUnmountVol, followed by PBEject to get rid of all traces of the
volume and kick it out of the drive.
If you are using a string in the ioNamePtr field to specify a volume name,
the string must be in the following form
myVolParam.ioNamePtr = "\pMy HardDisk:
The trailing colon on the string indicates that we are referring to a
directory, not a file.